﻿var urlSuffix = ".aspx";

function loadModule(module, path, divId, effect) {
    $.ajax({
        type: "POST",
        url: path + urlSuffix,
        dataType: "html",
        success: function(result) {
            $("#" + divId.toLowerCase()).html(result.toString());
            if (effect.length > 0) {
                $("#" + divId).show(effect);
            }
        },
        error: function() {
            //alert("Module " + module + " error");
        }
    });
}


function changeLanguage(id) {
    loadModule("Menu", "/Home/Menu/" + id.toString(), "menu", "");    
    loadModule("Left", "/Home/Left/" + id.toString(), "left", "");
    loadModule("Right", "/Home/Right/" + id.toString(), "right", "");
    loadModule("Footer", "/Home/Footer/" + id.toString(), "footer", "");
    loadModule("Content", "/Home/Content/" + id.toString(), "content", "");
}